﻿@using TjZheng.Logger.DataEntity;
@inherits CMSWebViewPage<LogCategory>
@{
    ViewBag.Title = "日志分类编辑页";
    Layout = "~/Views/Shared/_EditLayout.cshtml";
}
@section Head{
}
<div class="easyui-layout" data-options="fit:true">
    <div data-options="region:'center',border:false">
        <div class="top-block">
            @CurrentButtonTool.Create()
        </div>
        <form id="fr_logcategory" method="post" enctype="multipart/form-data">
            @*@Html.AntiForgeryToken()*@
            <table class="tblContent">
                <colgroup>
                    <col class="colTitle">
                    <col class="colContent" />
                </colgroup>
                <tr>
                    <td><span class="txtNoNull">*</span>分类名称:</td>
                    <td>
                        @Html.Hidden("objProvide.Id", Model.Id, false)
                        @Html.Hidden("objProvide.ParentId", TransferID, false)
                        @Html.StringBox("objProvide.CategoryName", Model.CategoryName, true, "请输入分类名称", null, ValidType.Length(64))
                    </td>
                </tr>
                <tr>
                    <td><span class="txtNoNull">*</span>分类编码:</td>
                    <td>
                        @Html.ComboBox("objProvide.CategoryCode", Model.CategoryCode, true, "请选择分类编码", "/LogCategory/LogTypeList")
                    </td>
                </tr>
                <tr>
                    <td><span class="txtNoNull">*</span>存储类型:</td>
                    <td>
                        @Html.CheckBoxList("objProvide.SaveType", Model.SaveType, true, new List<SelectListItem>
                       {
                           new SelectListItem{Value="0",Text="db"},
                           new SelectListItem{Value="1",Text="file"}
                       })
                    </td>
                </tr>
            </table>
        </form>
    </div>
</div>
@section Bottom{
    <script type="text/javascript">
        function Save() {
            var objFormEntity = new FormEntity("#fr_logcategory");
            objFormEntity.url = "/logcategory/save/";
            objFormEntity.submitSuccess = function (InvokeResult) {
                if (InvokeResult.ResultCode == "Success") {
                    ShowMessage(InvokeResult.ResultMessage);
                    window.parent.RefreshTree();
                    Back();
                } else {
                    ShowMessage(InvokeResult.ResultMessage);
                }
            };
            objFormEntity.isClearData = false;
            objFormEntity.submit();
        }
        function Back() {
            TransferToUrl("/logcategory/logcategoryindex");
        }
    </script>
}
